<script setup>
import {ref} from 'vue'
</script>

<template>
    <div class="nav">
        <div class="wrapper">
            <!-- dropdown start -->
            <div class="dropdown fl">
                <div class="dt">全部书籍分类</div>
                <div class="dd">
                    <ul>
                        <li><RouterLink :to="`/category/0`">文学小说<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/1`">教育考试<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/2`">期刊杂志<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/3`">人文社科<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/4`">经营励志<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/5`">科技IT<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/6`">艺术<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/7`">生活<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/8`">原版<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/9`">漫画<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/10`">童书<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                        <li><RouterLink :to="`/category/11`">报纸<el-icon><ArrowRightBold /></el-icon></RouterLink></li>
                    </ul>
                </div>
            </div>
            <!-- dropdown end -->

            <!-- up nav start -->
            <div class="up-nav fl">
                <ul>
                    <li class="style-red"><a href="#">热门图书</a></li>
                    <li><a>最新图书</a></li>
                    <li><a>海外图书</a></li>
                    <li><a @click="$router.push('/exchange')">书籍交换</a></li>
                    <li><a>更多精彩</a></li>
                </ul>
            </div>
            <!-- up nav end -->
        </div>
    </div>
</template>

<style scoped>
.nav {
    height: 45px;
    border-bottom: 2px solid #b1191a;
}

.dropdown {
    width: 209px;
    height: 45px;
}

.dropdown .dt {
    height: 100%;
    background-color: #b1191a;
    font-size: 16px;
    color: #fff;
    text-align: center;
    line-height: 45px;
    border-radius: 20px 20px 0 0;
}

.dropdown .dd {
    height: 380px;
    background-color: #c81623;
    margin-top: 2px;
    border-radius: 0 0 20px 20px;
}

.dd li {
    height: 31px;
    line-height: 31px;
    margin-left: 1px;
    padding: 0 10px;
    transition: all 0.5s;
}

.dd li:hover {
    background-color: #fff;
}

.dd li:hover {
    padding-left: 20px;
}

.dd li:hover a {
    color: #c81623;
}

.dd li i {
    float: right;
    font-family: 'icomoon';
    font-size: 18px;
    color: #fff;
}

.dd li a {
    font-size: 14px;
    color: #fff;
}

.up-nav {
    margin-left: 10px;
    margin-bottom: 10px;
}
.up-nav li {
    float: left;
    background-color: #f1f1f1;
}

.up-nav li:first-child {
    border-radius: 20px 0 0 20px;
}

.up-nav li:last-child {
    border-radius: 0 20px 20px 0;
}

.up-nav li a {
    display: block;
    height: 45px;
    padding: 0 25px;
    line-height: 45px;
    font-size: 16px;
    transition: all 0.3s;
}

</style>